from datetime import datetime

from src.baseapp.model import db, CustomDbModel
from src.baseapp.model.testcaseServiceModel.testPlanModel import PlanModel
from src.baseapp.model.testcaseServiceModel.testcaseModel import TestCaseModel


class PlanTestcaseMappingModel(CustomDbModel):
    """
    测试计划用例映射表
    """
    __tablename__ = 'plan_testcase_mapping'

    # 主键ID
    mapping_id = db.Column(db.Integer, primary_key=True, autoincrement=True)

    # 测试计划ID
    plan_id = db.Column(db.Integer, nullable=False)

    # 测试用例ID
    testcase_id = db.Column(db.Integer, nullable=False)

    # 状态 0:未执行 1:通过 2:失败 3:阻塞 4:跳过
    status = db.Column(db.Integer, nullable=False, default=0)

    # 执行备注
    remark = db.Column(db.String(255), nullable=True)
